/**
 * @file:          Config_StepperMotor.c
 * @brief:
 * @details:
 * @author:        wjh
 * @date created:  2023.06.12
 * @version:       1.0.0
 * @par copyright (c):
 *
 * @par history (desc):
 *   version:1.0.0, wjh, 2023.06.12,12:43:05
 */
/*** Include Files **************************************************************/
#include "ConfigOption.h"
#include "string.h"
#include "main.h"

/* Macro Definition ***********************************************************/
/* Flash param version */
#define FLASH_PARAM_VERSION_MAJOR ((uint8_t)3) /* Param's order has changed, or param's name has changed. */
#define FLASH_PARAM_VERSION_MINOR ((uint8_t)0) /* Add new param to the end, but the order hasn't. changed */
#define FLASH_PARAM_RELEASE_DATE ("2025-04-24 23:32:45")

/* Function Declare ***********************************************************/

/* Global Variable Define *****************************************************/
void Config_FlashManager_Param(FlashManager *self);
FlashManager flash_manager_param_v1_0 = {.ConfigParam = Config_FlashManager_Param};
void Config_FlashManager_Param(FlashManager *self)
{
    volatile StepperMotorController *smc = &stepper_motor_controller;

    memset(self, 0, sizeof(FlashManager));
    self->ConfigParam = Config_FlashManager_Param;
    self->Init = FlashManager_Init;
    self->RegisterVariableToTable = FlashManager_RegisterVariableToTable;

    self->param_version.number.all = (((uint16_t)FLASH_PARAM_VERSION_MAJOR << 8) | ((uint16_t)FLASH_PARAM_VERSION_MINOR));
    self->param_version.release_date = FLASH_PARAM_RELEASE_DATE;

    self->param_flash_start_addr = (void *)0x08022C00UL; //(void *)0x0801FC00UL;
    self->param_flash_size_byte = 1024UL;                // 1 * 1024UL;
    self->param_flash_param_valid_key = 23333;
    self->param_checksum_restore_en = 0;

    /***** Flash param register *****/
    /*** basic param */
    self->RegisterVariableToTable(self, FlashParamId_param_boot_key, FlashParam_RebootToTakeEffect_No, &(smc->param_boot_key), sizeof(smc->param_boot_key), "uint16_t", "boot_key");
    self->RegisterVariableToTable(self, FlashParamId_param_use_default_param, FlashParam_RebootToTakeEffect_No, &(smc->param_use_default_param), sizeof(smc->param_use_default_param), "uint16_t", "use_default_param");
    self->RegisterVariableToTable(self, FlashParamId_param_fireware_version, FlashParam_RebootToTakeEffect_No, &(smc->param_firmware_version.number.all), sizeof(smc->param_firmware_version.number.all), "uint32_t", "fireware_version");
    self->RegisterVariableToTable(self, FlashParamId_param_flash_param_version, FlashParam_RebootToTakeEffect_No, &(smc->flash_manager_param->param_version.number.all), sizeof(smc->flash_manager_param->param_version.number.all), "uint16_t", "flash_param_version");

    /*** reserved param */
    self->RegisterVariableToTable(self, FlashParamId_param_elec_offset, FlashParam_RebootToTakeEffect_No, &(smc->param_elec_offset), sizeof(smc->param_elec_offset), "float", "elec_offset");
    self->RegisterVariableToTable(self, FlashParamId_param_elec_offset_err_deg, FlashParam_RebootToTakeEffect_No, &(smc->elec_offset_err_deg), sizeof(smc->elec_offset_err_deg), "float", "elec_offset_err_deg");
    self->RegisterVariableToTable(self, FlashParamId_param_phase_order_invert, FlashParam_RebootToTakeEffect_No, &(smc->param_phase_order_invert), sizeof(smc->param_phase_order_invert), "int16_t", "phase_order_invert");

    /*** general param */
    self->RegisterVariableToTable(self, FlashParamId_param_flash_key_write_retries_num, FlashParam_RebootToTakeEffect_No, &(smc->param_flash_key_write_retries_num), sizeof(smc->param_flash_key_write_retries_num), "uint16_t", "flash_key_write_retries_num");
    self->RegisterVariableToTable(self, FlashParamId_param_system_startup_delay_ms, FlashParam_RebootToTakeEffect_No, &(smc->param_system_startup_delay_ms), sizeof(smc->param_system_startup_delay_ms), "uint16_t", "system_startup_delay_ms");
    self->RegisterVariableToTable(self, FlashParamId_param_pwm_period_s, FlashParam_RebootToTakeEffect_Yes, &(smc->param_pwm_period_s), sizeof(smc->param_pwm_period_s), "float", "pwm_period_s");
    self->RegisterVariableToTable(self, FlashParamId_param_task_period_s, FlashParam_RebootToTakeEffect_Yes, &(smc->param_task_period_s), sizeof(smc->param_task_period_s), "float", "task_period_s");
    self->RegisterVariableToTable(self, FlashParamId_param_singleturn_control_mode, FlashParam_RebootToTakeEffect_No, &(smc->param_singleturn_control_mode), sizeof(smc->param_singleturn_control_mode), "uint16_t", "singleturn_control_mode");
    self->RegisterVariableToTable(self, FlashParamId_param_elec_angle_calibration_standar_deg, FlashParam_RebootToTakeEffect_No, &(smc->param_elec_angle_calibration_standar_deg), sizeof(smc->param_elec_angle_calibration_standar_deg), "float", "elec_angle_calibration_standar_deg");
    self->RegisterVariableToTable(self, FlashParamId_param_emergency_pin_mode, FlashParam_RebootToTakeEffect_No, &(smc->param_emergency_pin_mode), sizeof(smc->param_emergency_pin_mode), "uint16_t", "emergency_pin_mode");
    self->RegisterVariableToTable(self, FlashParamId_param_stall_mode, FlashParam_RebootToTakeEffect_No, &(smc->param_stall_mode), sizeof(smc->param_stall_mode), "uint16_t", "stall_mode");
    self->RegisterVariableToTable(self, FlashParamId_param_stall_cur_A, FlashParam_RebootToTakeEffect_No, &(smc->param_stall_cur_A), sizeof(smc->param_stall_cur_A), "float", "stall_cur_A");
    self->RegisterVariableToTable(self, FlashParamId_param_stall_pos_err_rad, FlashParam_RebootToTakeEffect_No, &(smc->param_stall_pos_err_rad), sizeof(smc->param_stall_pos_err_rad), "float", "stall_pos_err_rad");
    self->RegisterVariableToTable(self, FlashParamId_param_stall_pos_err_rad_for_slicer, FlashParam_RebootToTakeEffect_No, &(smc->param_stall_pos_err_rad_for_slicer), sizeof(smc->param_stall_pos_err_rad_for_slicer), "float", "stall_pos_err_rad_for_slicer");
    // self->RegisterVariableToTable(self, FlashParamId_param_calibration_dir, FlashParam_RebootToTakeEffect_No, &(smc->param_calibration_dir), sizeof(smc->param_calibration_dir), "int16_t", "calibration_dir");
    // self->RegisterVariableToTable(self, FlashParamId_param_encoder_cal_count_max, FlashParam_RebootToTakeEffect_No, &(smc->param_encoder_cal_count_max), sizeof(smc->param_encoder_cal_count_max), "int32_t", "encoder_cal_count_max");
    // self->RegisterVariableToTable(self, FlashParamId_param_encoder_read_count, FlashParam_RebootToTakeEffect_No, &(smc->param_encoder_read_count), sizeof(smc->param_encoder_read_count), "uint16_t", "encoder_read_count");
    // self->RegisterVariableToTable(self, FlashParamId_param_delay_ms_per_step, FlashParam_RebootToTakeEffect_No, &(smc->param_delay_ms_per_step), sizeof(smc->param_delay_ms_per_step), "uint16_t", "delay_ms_per_step");
    // self->RegisterVariableToTable(self, FlashParamId_param_delay_ms_per_read, FlashParam_RebootToTakeEffect_No, &(smc->param_delay_ms_per_read), sizeof(smc->param_delay_ms_per_read), "uint16_t", "delay_ms_per_read");
    self->RegisterVariableToTable(self, FlashParamId_param_ud_cal_set, FlashParam_RebootToTakeEffect_No, &(smc->param_ud_cal_set), sizeof(smc->param_ud_cal_set), "float", "ud_cal_set");
    self->RegisterVariableToTable(self, FlashParamId_param_motion_dir, FlashParam_RebootToTakeEffect_No, &(smc->param_motion_dir), sizeof(smc->param_motion_dir), "float", "motion_dir");
    // self->RegisterVariableToTable(self, FlashParamId_param_encoder_calibtate_official_cal_count_max, FlashParam_RebootToTakeEffect_No, &(smc->param_encoder_calibtate_official_cal_count_max), sizeof(smc->param_encoder_calibtate_official_cal_count_max), "uint32_t", "encoder_calibtate_official_cal_count_max");
    self->RegisterVariableToTable(self, FlashParamId_param_encoder_calibtate_official_ud_cal_set, FlashParam_RebootToTakeEffect_No, &(smc->param_encoder_calibtate_official_ud_cal_set), sizeof(smc->param_encoder_calibtate_official_ud_cal_set), "float", "encoder_calibtate_official_ud_cal_set");
    // self->RegisterVariableToTable(self, FlashParamId_param_encoder_calibration_round_count, FlashParam_RebootToTakeEffect_No, &(smc->param_encoder_calibration_round_count), sizeof(smc->param_encoder_calibration_round_count), "uint32_t", "encoder_calibration_round_count");

    /*** driver board param */
    self->RegisterVariableToTable(self, FlashParamId_driver_board_param_power_supply_V, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_power_supply_V), sizeof(smc->driver_board->param_power_supply_V), "float", "driver_board_power_supply_V");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_adc_ref_V, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_adc_ref_V), sizeof(smc->driver_board->param_adc_ref_V), "float", "driver_board_adc_ref_V");
    self->RegisterVariableToTable(self, FlashParamId_driver_board_param_amp_gain, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_amp_gain), sizeof(smc->driver_board->param_amp_gain), "float", "driver_board_amp_gain");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_power_voltage_sample_gain, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_power_voltage_sample_gain), sizeof(smc->driver_board->param_power_voltage_sample_gain), "float", "driver_board_power_voltage_sample_gain");
    self->RegisterVariableToTable(self, FlashParamId_driver_board_param_R_of_current_sample_ohm, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_R_of_current_sample_ohm), sizeof(smc->driver_board->param_R_of_current_sample_ohm), "float", "driver_board_R_of_current_sample_ohm");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_adc_calibration_start_index, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_adc_calibration_start_index), sizeof(smc->driver_board->param_adc_calibration_start_index), "int16_t", "driver_board_adc_calibration_start_index");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_adc_calibration_buffer_size, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_adc_calibration_buffer_size), sizeof(smc->driver_board->param_adc_calibration_buffer_size), "int16_t", "driver_board_adc_calibration_buffer_size");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_led_toggle_period_s, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_led_toggle_period_s), sizeof(smc->driver_board->param_led_toggle_period_s), "float", "driver_board_led_toggle_period_s");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_current_dir, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_current_dir), sizeof(smc->driver_board->param_current_dir), "float", "driver_board_current_dir");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_pwm_output_en, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_pwm_output_en), sizeof(smc->driver_board->param_pwm_output_en), "uint16_t", "driver_board_pwm_output_en");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_mos_Ron, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_mos_Ron), sizeof(smc->driver_board->param_mos_Ron), "float", "driver_board_mos_Ron");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_mos_deadtime, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_mos_deadtime), sizeof(smc->driver_board->param_mos_deadtime), "float", "driver_board_mos_deadtime");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_mos_rise_fall_time, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_mos_rise_fall_time), sizeof(smc->driver_board->param_mos_rise_fall_time), "float", "driver_board_mos_rise_fall_time");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_mos_max_peak_current, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_mos_max_peak_current), sizeof(smc->driver_board->param_mos_max_peak_current), "float", "driver_board_mos_max_peak_current");
    // self->RegisterVariableToTable(self, FlashParamId_driver_board_param_mos_max_continuous_current, FlashParam_RebootToTakeEffect_No, &(smc->driver_board->param_mos_max_continuous_current), sizeof(smc->driver_board->param_mos_max_continuous_current), "float", "driver_board_mos_max_continuous_current");

    /*** motor param */
    self->RegisterVariableToTable(self, FlashParamId_motor_param_R, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_R), sizeof(smc->stepper_motor->param_R), "float", "motor_R");
    self->RegisterVariableToTable(self, FlashParamId_motor_param_L, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_L), sizeof(smc->stepper_motor->param_L), "float", "motor_L");
    self->RegisterVariableToTable(self, FlashParamId_motor_param_Ke, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_Ke), sizeof(smc->stepper_motor->param_Ke), "float", "motor_Ke");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_Kt, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_Kt), sizeof(smc->stepper_motor->param_Kt), "float", "motor_Kt");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_mass, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_mass), sizeof(smc->stepper_motor->param_mass), "float", "motor_mass");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_J, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_J), sizeof(smc->stepper_motor->param_J), "float", "motor_J");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_B, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_B), sizeof(smc->stepper_motor->param_B), "float", "motor_B");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_stepping_angle_degree, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_stepping_angle_degree), sizeof(smc->stepper_motor->param_stepping_angle_degree), "float", "motor_stepping_angle_degree");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_phase_nums, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_phase_nums), sizeof(smc->stepper_motor->param_phase_nums), "uint16_t", "motor_phase_nums");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_pole_pair, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_pole_pair), sizeof(smc->stepper_motor->param_pole_pair), "uint16_t", "motor_pole_pair");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_power_supply, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_power_supply), sizeof(smc->stepper_motor->param_power_supply), "float", "motor_power_supply");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_rated_voltage, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_rated_voltage), sizeof(smc->stepper_motor->param_rated_voltage), "float", "motor_rated_voltage");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_rated_current, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_rated_current), sizeof(smc->stepper_motor->param_rated_current), "float", "motor_rated_current");
    // self->RegisterVariableToTable(self, FlashParamId_motor_param_maximum_holding_torque, FlashParam_RebootToTakeEffect_No, &(smc->stepper_motor->param_maximum_holding_torque), sizeof(smc->stepper_motor->param_maximum_holding_torque), "float", "motor_maximum_holding_torque");

    /*** encoder param */
    // self->RegisterVariableToTable(self, FlashParamId_encoder_param_direction, FlashParam_RebootToTakeEffect_No, &(smc->encoder->param_direction), sizeof(smc->encoder->param_direction), "int32_t", "encoder_direction");
    // self->RegisterVariableToTable(self, FlashParamId_encoder_param_encoder_bit, FlashParam_RebootToTakeEffect_No, &(smc->encoder->parma_encoder_bit), sizeof(smc->encoder->parma_encoder_bit), "uint32_t", "encoder_encoder_bit");
    // self->RegisterVariableToTable(self, FlashParamId_encoder_param_encoder_max_pulse, FlashParam_RebootToTakeEffect_No, &(smc->encoder->param_encoder_max_pulse), sizeof(smc->encoder->param_encoder_max_pulse), "int32_t", "encoder_encoder_max_pulse");
    // self->RegisterVariableToTable(self, FlashParamId_encoder_param_fake_encoder_en, FlashParam_RebootToTakeEffect_No, &(smc->encoder->param_fake_encoder_en), sizeof(smc->encoder->param_fake_encoder_en), "uint16_t", "encoder_fake_encoder_en");
    // self->RegisterVariableToTable(self, FlashParamId_encoder_param_fake_encoder_step, FlashParam_RebootToTakeEffect_No, &(smc->encoder->param_fake_encoder_step), sizeof(smc->encoder->param_fake_encoder_step), "float", "encoder_fake_encoder_step");

    /*** mcu param */
    // self->RegisterVariableToTable(self, FlashParamId_mcu_param_sysclk_hz, FlashParam_RebootToTakeEffect_Yes, &(smc->mcu->param_sysclk_hz), sizeof(smc->mcu->param_sysclk_hz), "uint32_t", "mcu_sysclk_hz");
    // self->RegisterVariableToTable(self, FlashParamId_mcu_param_HSE_hz, FlashParam_RebootToTakeEffect_Yes, &(smc->mcu->param_HSE_hz), sizeof(smc->mcu->param_HSE_hz), "uint32_t", "mcu_HSE_hz");
    // self->RegisterVariableToTable(self, FlashParamId_mcu_param_uart_baudrate, FlashParam_RebootToTakeEffect_Yes, &(smc->mcu->param_uart_baudrate), sizeof(smc->mcu->param_uart_baudrate), "uint32_t", "mcu_uart_baudrate");
    self->RegisterVariableToTable(self, FlashParamId_mcu_param_input_pulse_counter_trigger_mode, FlashParam_RebootToTakeEffect_Yes, &(smc->mcu->param_input_pulse_counter_trigger_mode), sizeof(smc->mcu->param_input_pulse_counter_trigger_mode), "uint16_t", "mcu_input_pulse_counter_trigger_mode");
    self->RegisterVariableToTable(self, FlashParamId_mcu_param_input_pulse_counter_filter_level, FlashParam_RebootToTakeEffect_Yes, &(smc->mcu->param_input_pulse_counter_filter_level), sizeof(smc->mcu->param_input_pulse_counter_filter_level), "uint16_t", "mcu_input_pulse_counter_filter_level");

    /*** controller param */
    // self->RegisterVariableToTable(self, FlashParamId_controller_param_control_algorithm, FlashParam_RebootToTakeEffect_No, &(smc->controller->param_control_algorithm), sizeof(smc->controller->param_control_algorithm), "uint16_t", "controller->control_algorithm");
    self->RegisterVariableToTable(self, FlashParamId_controller_param_en_feedforward_idiq, FlashParam_RebootToTakeEffect_No, &(smc->controller->param_en_feedforward_idiq), sizeof(smc->controller->param_en_feedforward_idiq), "uint16_t", "en_ffd_idiq");
    self->RegisterVariableToTable(self, FlashParamId_controller_param_en_feedforward_uduq, FlashParam_RebootToTakeEffect_No, &(smc->controller->param_en_feedforward_uduq), sizeof(smc->controller->param_en_feedforward_uduq), "uint16_t", "en_ffd_uduq");

    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.param_en), sizeof(smc->controller->pos_loop_pid.param_en), "uint16_t", "pos.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_param_bypass, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.param_bypass), sizeof(smc->controller->pos_loop_pid.param_bypass), "uint16_t", "pos.bypass");
    self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_param_kp, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.param_kp), sizeof(smc->controller->pos_loop_pid.param_kp), "float", "pos.kp");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_param_ki, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.param_ki), sizeof(smc->controller->pos_loop_pid.param_ki), "float", "pos.ki");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_param_kd, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.param_kd), sizeof(smc->controller->pos_loop_pid.param_kd), "float", "pos.kd");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_param_kc, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.param_kc), sizeof(smc->controller->pos_loop_pid.param_kc), "float", "pos.kc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_ud_filter_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.ud_filter.param_en), sizeof(smc->controller->pos_loop_pid.ud_filter.param_en), "uint16_t", "pos.ud_filt.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_ud_filter_param_fc, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.ud_filter.param_fc), sizeof(smc->controller->pos_loop_pid.ud_filter.param_fc), "float", "pos.ud_filt.fc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_param_limit_ui, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.param_limit_ui), sizeof(smc->controller->pos_loop_pid.param_limit_ui), "float", "pos.limit_ui");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_parma_limit_out, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.parma_limit_out), sizeof(smc->controller->pos_loop_pid.parma_limit_out), "float", "pos.limit_out");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_fal_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.fal.param_en), sizeof(smc->controller->pos_loop_pid.fal.param_en), "uint16_t", "pos.fal.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_fal_param_a, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.fal.param_a), sizeof(smc->controller->pos_loop_pid.fal.param_a), "float", "pos.fal.a");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_fal_param_d, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.fal.param_d), sizeof(smc->controller->pos_loop_pid.fal.param_d), "float", "pos.fal.d");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_fal_param_zoom, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.fal.param_zoom), sizeof(smc->controller->pos_loop_pid.fal.param_zoom), "float", "pos.fal.zoom");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_fal_param_section_nums, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.fal.param_section_nums), sizeof(smc->controller->pos_loop_pid.fal.param_section_nums), "uint16_t", "pos.fal.sec_num");
    // self->RegisterVariableToTable(self, FlashParamId_controller_pos_loop_pid_fal_param_inteval_gain, FlashParam_RebootToTakeEffect_No, &(smc->controller->pos_loop_pid.fal.param_inteval_gain), sizeof(smc->controller->pos_loop_pid.fal.param_inteval_gain), "float", "pos.fal.inteval_g");

    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.param_en), sizeof(smc->controller->spd_loop_pid.param_en), "uint16_t", "spd.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_param_bypass, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.param_bypass), sizeof(smc->controller->spd_loop_pid.param_bypass), "uint16_t", "spd.bypass");
    self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_param_kp, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.param_kp), sizeof(smc->controller->spd_loop_pid.param_kp), "float", "spd.kp");
    self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_param_ki, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.param_ki), sizeof(smc->controller->spd_loop_pid.param_ki), "float", "spd.ki");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_param_kd, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.param_kd), sizeof(smc->controller->spd_loop_pid.param_kd), "float", "spd.kd");
    self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_param_kc, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.param_kc), sizeof(smc->controller->spd_loop_pid.param_kc), "float", "spd.kc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_ud_filter_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.ud_filter.param_en), sizeof(smc->controller->spd_loop_pid.ud_filter.param_en), "uint16_t", "spd.ud_filt.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_ud_filter_param_fc, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.ud_filter.param_fc), sizeof(smc->controller->spd_loop_pid.ud_filter.param_fc), "float", "spd.ud_filt.fc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_param_limit_ui, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.param_limit_ui), sizeof(smc->controller->spd_loop_pid.param_limit_ui), "float", "spd.limit_ui");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_parma_limit_out, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.parma_limit_out), sizeof(smc->controller->spd_loop_pid.parma_limit_out), "float", "spd.limit_out");
    self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_fal_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.fal.param_en), sizeof(smc->controller->spd_loop_pid.fal.param_en), "uint16_t", "spd.fal.en");
    self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_fal_param_a, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.fal.param_a), sizeof(smc->controller->spd_loop_pid.fal.param_a), "float", "spd.fal.a");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_fal_param_d, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.fal.param_d), sizeof(smc->controller->spd_loop_pid.fal.param_d), "float", "spd.fal.d");
    self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_fal_param_zoom, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.fal.param_zoom), sizeof(smc->controller->spd_loop_pid.fal.param_zoom), "float", "spd.fal.zoom");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_fal_param_section_nums, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.fal.param_section_nums), sizeof(smc->controller->spd_loop_pid.fal.param_section_nums), "uint16_t", "spd.fal.sec_num");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_loop_pid_fal_param_inteval_gain, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_loop_pid.fal.param_inteval_gain), sizeof(smc->controller->spd_loop_pid.fal.param_inteval_gain), "float", "spd.fal.inteval_g");

    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.param_en), sizeof(smc->controller->id_loop_pid.param_en), "uint16_t", "cur.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_param_bypass, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.param_bypass), sizeof(smc->controller->id_loop_pid.param_bypass), "uint16_t", "cur.bypass");
    self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_param_kp, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.param_kp), sizeof(smc->controller->id_loop_pid.param_kp), "float", "cur.kp");
    self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_param_ki, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.param_ki), sizeof(smc->controller->id_loop_pid.param_ki), "float", "cur.ki");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_param_kd, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.param_kd), sizeof(smc->controller->id_loop_pid.param_kd), "float", "cur.kd");
    self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_param_kc, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.param_kc), sizeof(smc->controller->id_loop_pid.param_kc), "float", "cur.kc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_ud_filter_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.ud_filter.param_en), sizeof(smc->controller->id_loop_pid.ud_filter.param_en), "uint16_t", "cur.ud_filt.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_ud_filter_param_fc, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.ud_filter.param_fc), sizeof(smc->controller->id_loop_pid.ud_filter.param_fc), "float", "cur.ud_filt.fc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_param_limit_ui, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.param_limit_ui), sizeof(smc->controller->id_loop_pid.param_limit_ui), "float", "cur.limit_ui");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_parma_limit_out, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.parma_limit_out), sizeof(smc->controller->id_loop_pid.parma_limit_out), "float", "cur.limit_out");
    self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_fal_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.fal.param_en), sizeof(smc->controller->id_loop_pid.fal.param_en), "uint16_t", "cur.fal.en");
    self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_fal_param_a, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.fal.param_a), sizeof(smc->controller->id_loop_pid.fal.param_a), "float", "cur.fal.a");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_fal_param_d, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.fal.param_d), sizeof(smc->controller->id_loop_pid.fal.param_d), "float", "cur.fal.d");
    self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_fal_param_zoom, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.fal.param_zoom), sizeof(smc->controller->id_loop_pid.fal.param_zoom), "float", "cur.fal.zoom");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_fal_param_section_nums, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.fal.param_section_nums), sizeof(smc->controller->id_loop_pid.fal.param_section_nums), "uint16_t", "cur.fal.sec_num");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_loop_pid_fal_param_inteval_gain, FlashParam_RebootToTakeEffect_No, &(smc->controller->id_loop_pid.fal.param_inteval_gain), sizeof(smc->controller->id_loop_pid.fal.param_inteval_gain), "float", "cur.fal.inteval_g");

    self->RegisterVariableToTable(self, FlashParamId_controller_leso_param_b0k, FlashParam_RebootToTakeEffect_No, &(smc->controller->leso.param_b0k), sizeof(smc->controller->leso.param_b0k), "float", "leso.b0k");
    self->RegisterVariableToTable(self, FlashParamId_controller_leso_param_b0, FlashParam_RebootToTakeEffect_No, &(smc->controller->leso.param_b0), sizeof(smc->controller->leso.param_b0), "float", "leso.b0");
    self->RegisterVariableToTable(self, FlashParamId_controller_leso_param_z3k, FlashParam_RebootToTakeEffect_No, &(smc->controller->leso.param_z3k), sizeof(smc->controller->leso.param_z3k), "float", "leso.z3k");
    self->RegisterVariableToTable(self, FlashParamId_controller_leso_param_wp, FlashParam_RebootToTakeEffect_No, &(smc->controller->leso.param_wp), sizeof(smc->controller->leso.param_wp), "float", "leso.wp");
    self->RegisterVariableToTable(self, FlashParamId_controller_leso_param_ws, FlashParam_RebootToTakeEffect_No, &(smc->controller->leso.param_ws), sizeof(smc->controller->leso.param_ws), "float", "leso.ws");
    self->RegisterVariableToTable(self, FlashParamId_controller_leso_param_wd, FlashParam_RebootToTakeEffect_No, &(smc->controller->leso.param_wd), sizeof(smc->controller->leso.param_wd), "float", "leso.wd");

    self->RegisterVariableToTable(self, FlashParamId_controller_fwc_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->fwc.param_en), sizeof(smc->controller->fwc.param_en), "uint16_t", "fwc.en");
    self->RegisterVariableToTable(self, FlashParamId_controller_fwc_param_I_max, FlashParam_RebootToTakeEffect_No, &(smc->controller->fwc.param_I_max), sizeof(smc->controller->fwc.param_I_max), "float", "fwc.I_max");
    // self->RegisterVariableToTable(self, FlashParamId_controller_fwc_param_L, FlashParam_RebootToTakeEffect_No, &(smc->controller->fwc.param_L), sizeof(smc->controller->fwc.param_L), "float", "fwc.L");
    self->RegisterVariableToTable(self, FlashParamId_controller_fwc_param_phi_e, FlashParam_RebootToTakeEffect_No, &(smc->controller->fwc.param_phi_e), sizeof(smc->controller->fwc.param_phi_e), "float", "fwc.phi_e");
    // self->RegisterVariableToTable(self, FlashParamId_controller_fwc_param_pole_pair, FlashParam_RebootToTakeEffect_No, &(smc->controller->fwc.param_pole_pair), sizeof(smc->controller->fwc.param_pole_pair), "uint16_t", "fwc.pole_pair");
    self->RegisterVariableToTable(self, FlashParamId_controller_fwc_param_wm_base, FlashParam_RebootToTakeEffect_No, &(smc->controller->fwc.param_wm_base), sizeof(smc->controller->fwc.param_wm_base), "float", "fwc.wm_base");

    self->RegisterVariableToTable(self, FlashParamId_controller_cur_filter_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->ialpha_filter.param_en), sizeof(smc->controller->ialpha_filter.param_en), "uint16_t", "iaib_filter.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_cur_filter_param_Ts, FlashParam_RebootToTakeEffect_No, &(smc->controller->ialpha_filter.param_Ts), sizeof(smc->controller->ialpha_filter.param_Ts), "float", "iaib_filter.Ts");
    self->RegisterVariableToTable(self, FlashParamId_controller_cur_filter_param_fc, FlashParam_RebootToTakeEffect_No, &(smc->controller->ialpha_filter.param_fc), sizeof(smc->controller->ialpha_filter.param_fc), "float", "iaib_filter.fc");

    // self->RegisterVariableToTable(self, FlashParamId_controller_z3_filter_binary_second_order_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->z3_filter_binary_second_order.param_en), sizeof(smc->controller->z3_filter_binary_second_order.param_en), "uint16_t", "z3_filter.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_z3_filter_binary_second_order_param_fc, FlashParam_RebootToTakeEffect_No, &(smc->controller->z3_filter_binary_second_order.param_fc), sizeof(smc->controller->z3_filter_binary_second_order.param_fc), "float", "z3_filter.fc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_z3_filter_binary_second_order_param_depth, FlashParam_RebootToTakeEffect_No, &(smc->controller->z3_filter_binary_second_order.param_depth), sizeof(smc->controller->z3_filter_binary_second_order.param_depth), "float", "z3_filter.depth");
    // self->RegisterVariableToTable(self, FlashParamId_controller_z3_filter_binary_second_order_param_zeta_0N, FlashParam_RebootToTakeEffect_No, &(smc->controller->z3_filter_binary_second_order.param_zeta_0N), sizeof(smc->controller->z3_filter_binary_second_order.param_zeta_0N), "float", "z3_filter.zeta_0N");
    // self->RegisterVariableToTable(self, FlashParamId_controller_z3_filter_binary_second_order_param_zeta_0D, FlashParam_RebootToTakeEffect_No, &(smc->controller->z3_filter_binary_second_order.param_zeta_0D), sizeof(smc->controller->z3_filter_binary_second_order.param_zeta_0D), "float", "z3_filter.zeta_0D");

    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_binary_second_order_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_binary_second_order.param_en), sizeof(smc->controller->spd_out_filter_binary_second_order.param_en), "uint16_t", "spdout_filter.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_binary_second_order_param_fc, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_binary_second_order.param_fc), sizeof(smc->controller->spd_out_filter_binary_second_order.param_fc), "float", "spdout_filter.fc");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_binary_second_order_param_depth, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_binary_second_order.param_depth), sizeof(smc->controller->spd_out_filter_binary_second_order.param_depth), "float", "spdout_filter.depth");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_binary_second_order_param_zeta_0N, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_binary_second_order.param_zeta_0N), sizeof(smc->controller->spd_out_filter_binary_second_order.param_zeta_0N), "float", "spdout_filter.0N");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_binary_second_order_param_zeta_0D, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_binary_second_order.param_zeta_0D), sizeof(smc->controller->spd_out_filter_binary_second_order.param_zeta_0D), "float", "spdout_filter.0D");

    // self->RegisterVariableToTable(self, FlashParamId_controller_td_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->td.param_en), sizeof(smc->controller->td.param_en), "uint16_t", "td.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_td_param_h0_gain_h, FlashParam_RebootToTakeEffect_No, &(smc->controller->td.param_h0_gain_h), sizeof(smc->controller->td.param_h0_gain_h), "float", "td.h0_gain_h");
    // self->RegisterVariableToTable(self, FlashParamId_controller_td_fhan_param_f0, FlashParam_RebootToTakeEffect_No, &(smc->controller->td.fhan.param_f0), sizeof(smc->controller->td.fhan.param_f0), "float", "td.f0");
    // self->RegisterVariableToTable(self, FlashParamId_controller_td_param_d_gain, FlashParam_RebootToTakeEffect_No, &(smc->controller->td.param_d_gain), sizeof(smc->controller->td.param_d_gain), "float", "td.d_gain");
    // self->RegisterVariableToTable(self, FlashParamId_controller_td_param_dd_gain, FlashParam_RebootToTakeEffect_No, &(smc->controller->td.param_dd_gain), sizeof(smc->controller->td.param_dd_gain), "float", "td.dd_gain");

    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_0_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[0].param_en), sizeof(smc->controller->spd_out_filter_notch[0].param_en), "uint16_t", "filter[0].en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_0_param_f0, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[0].param_f0), sizeof(smc->controller->spd_out_filter_notch[0].param_f0), "float", "filter[0].f0");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_0_param_f_width, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[0].param_f_width), sizeof(smc->controller->spd_out_filter_notch[0].param_f_width), "float", "filter[0].f_width");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_0_param_depth, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[0].param_depth), sizeof(smc->controller->spd_out_filter_notch[0].param_depth), "float", "filter[0].depth");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_1_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[1].param_en), sizeof(smc->controller->spd_out_filter_notch[1].param_en), "uint16_t", "filter[1].en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_1_param_f0, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[1].param_f0), sizeof(smc->controller->spd_out_filter_notch[1].param_f0), "float", "filter[1].f0");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_1_param_f_width, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[1].param_f_width), sizeof(smc->controller->spd_out_filter_notch[1].param_f_width), "float", "filter[1].f_width");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_1_param_depth, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[1].param_depth), sizeof(smc->controller->spd_out_filter_notch[1].param_depth), "float", "filter[1].depth");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_2_param_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[2].param_en), sizeof(smc->controller->spd_out_filter_notch[2].param_en), "uint16_t", "filter[2].en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_2_param_f0, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[2].param_f0), sizeof(smc->controller->spd_out_filter_notch[2].param_f0), "float", "filter[2].f0");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_2_param_f_width, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[2].param_f_width), sizeof(smc->controller->spd_out_filter_notch[2].param_f_width), "float", "filter[2].f_width");
    // self->RegisterVariableToTable(self, FlashParamId_controller_spd_out_filter_notch_2_param_depth, FlashParam_RebootToTakeEffect_No, &(smc->controller->spd_out_filter_notch[2].param_depth), sizeof(smc->controller->spd_out_filter_notch[2].param_depth), "float", "filter[2].depth");

    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_en, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.en), sizeof(smc->controller->motor_ripple_compensator.en), "uint16_t", "ripple.en");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_0_term_A, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[0].term.A), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[0].term.A), "float", "ripple[0].A");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_0_term_n, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[0].term.n), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[0].term.n), "float", "ripple[0].n");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_0_term_phi, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[0].term.phi), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[0].term.phi), "float", "ripple[0].phi");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_1_term_A, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[1].term.A), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[1].term.A), "float", "ripple[1].A");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_1_term_n, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[1].term.n), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[1].term.n), "float", "ripple[1].n");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_1_term_phi, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[1].term.phi), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[1].term.phi), "float", "ripple[1].phi");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_2_term_A, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[2].term.A), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[2].term.A), "float", "ripple[2].A");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_2_term_n, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[2].term.n), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[2].term.n), "float", "ripple[2].n");
    // self->RegisterVariableToTable(self, FlashParamId_controller_motor_ripple_compensator_sin_coeffs_2_term_phi, FlashParam_RebootToTakeEffect_No, &(smc->controller->motor_ripple_compensator.sin_coeffs[1].term.phi), sizeof(smc->controller->motor_ripple_compensator.sin_coeffs[2].term.phi), "float", "ripple[2].phi");

    /*** flash manager param */
    self->RegisterVariableToTable(self, FlashParamId_flash_manager_param_checksum_restore_en, FlashParam_RebootToTakeEffect_No, &(smc->flash_manager_param->param_checksum_restore_en), sizeof(smc->flash_manager_param->param_checksum_restore_en), "uint16_t", "flashmg_checksum_restore_en");

    /*** logger param */
    // self->RegisterVariableToTable(self, FlashParamId_logger_param_en, FlashParam_RebootToTakeEffect_No, &(smc->logger->param_en), sizeof(smc->logger->param_en), "uint16_t", "logger_en");
    // self->RegisterVariableToTable(self, FlashParamId_logger_param_continuous_send, FlashParam_RebootToTakeEffect_No, &(smc->logger->param_continuous_send), sizeof(smc->logger->param_continuous_send), "uint16_t", "logger_continuous_send");
    // self->RegisterVariableToTable(self, FlashParamId_logger_param_sample_interval_n, FlashParam_RebootToTakeEffect_No, &(smc->logger->param_sample_interval_n), sizeof(smc->logger->param_sample_interval_n), "uint16_t", "logger_sample_interval_n");
    // self->RegisterVariableToTable(self, FlashParamId_logger_param_n_pack_to_send, FlashParam_RebootToTakeEffect_No, &(smc->logger->param_n_pack_to_send), sizeof(smc->logger->param_n_pack_to_send), "uint32_t", "logger_n_pack_to_send");

    /*** protection param */
    self->RegisterVariableToTable(self, FlashParamId_protection_param_protect_en, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_en), sizeof(smc->protection.param_en), "uint16_t", "protect_en");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_protect_report, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_enable_report), sizeof(smc->protection.param_enable_report), "uint16_t", "protect_report");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_err_code_mask, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_err_code_mask), sizeof(smc->protection.param_err_code_mask), "uint32_t", "protect_err_code_mask");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_warning_code_mask, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_warning_code_mask), sizeof(smc->protection.param_warning_code_mask), "uint32_t", "protect_warning_code_mask");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_encoder_mutation_coefficient_upper, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_encoder_mutation_coefficient_upper), sizeof(smc->protection.param_encoder_mutation_coefficient_upper), "float", "protect_encoder_mutation_coefficient_upper");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_encoder_mutation_coefficient_lower, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_encoder_mutation_coefficient_lower), sizeof(smc->protection.param_encoder_mutation_coefficient_lower), "float", "protect_encoder_mutation_coefficient_lower");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_peak_cur_A, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_peak_overcurrent_A), sizeof(smc->protection.param_peak_overcurrent_A), "float", "protect_peak_overcurrent_A");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_continuous_cur_A, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_continuous_overcurrent_A), sizeof(smc->protection.param_continuous_overcurrent_A), "float", "protect_continuous_overcurrent_A");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_continuous_time_s, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_continuous_overcurrent_time_s), sizeof(smc->protection.param_continuous_overcurrent_time_s), "float", "protect_continuous_overcurrent_time_s");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_continuous_clear_time_s, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_continuous_overcurrent_clear_time_s), sizeof(smc->protection.param_continuous_overcurrent_clear_time_s), "float", "protect_continuous_overcurrent_clear_time_s");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_over_speed_rad_s, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_speed_over_limit_rad_s), sizeof(smc->protection.param_speed_over_limit_rad_s), "float", "protect_speed_over_limit_rad_s");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_over_speed_time_s, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_speed_over_limit_time_s), sizeof(smc->protection.param_speed_over_limit_time_s), "float", "protect_speed_over_limit_time_s");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_pos_over_limit_max_rad, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_pos_over_limit_max_rad), sizeof(smc->protection.param_pos_over_limit_max_rad), "float", "protect_pos_over_limit_max_rad");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_pos_over_limit_min_rad, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_pos_over_limit_min_rad), sizeof(smc->protection.param_pos_over_limit_min_rad), "float", "protect_pos_over_limit_min_rad");
    // self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_cmd_mutation_turn, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_pos_cmd_mutation_turns), sizeof(smc->protection.param_pos_cmd_mutation_turns), "float", "protect_pos_cmd_mutation_turns");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_track_max_err, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_pos_tracking_error_maximum_rad), sizeof(smc->protection.param_pos_tracking_error_maximum_rad), "float", "protect_pos_tracking_error_maximum_rad");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_prt_track_err_time, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_pos_tracking_error_time_s), sizeof(smc->protection.param_pos_tracking_error_time_s), "float", "protect_pos_tracking_error_time_s");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_power_voltage_min, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_power_voltage_min), sizeof(smc->protection.param_power_voltage_min), "float", "protect_power_voltage_min");
    self->RegisterVariableToTable(self, FlashParamId_protection_param_mcu_temp_max, FlashParam_RebootToTakeEffect_No, &(smc->protection.param_mcu_temp_max), sizeof(smc->protection.param_mcu_temp_max), "float", "protect_mcu_temp_max");
    self->RegisterVariableToTable(self, FlashParamId_protection_err_code_backup, FlashParam_RebootToTakeEffect_No, &(smc->protection.err_code_backup), sizeof(smc->protection.err_code_backup), "uint32_t", "protect_err_code_backup");
    self->RegisterVariableToTable(self, FlashParamId_protection_warning_code_backup, FlashParam_RebootToTakeEffect_No, &(smc->protection.warning_code_backup), sizeof(smc->protection.warning_code_backup), "uint32_t", "protect_warning_code_backup");

    /*** chopper param */
    // self->RegisterVariableToTable(self, FlashParamId_chopper_param_chopper_mode, FlashParam_RebootToTakeEffect_No, &(smc->chopper.param_chopper_mode), sizeof(smc->chopper.param_chopper_mode), "uint16_t", "chopper_chopper_mode");
    // self->RegisterVariableToTable(self, FlashParamId_chopper_param_svpwm_mode, FlashParam_RebootToTakeEffect_No, &(smc->chopper.param_svpwm_mode), sizeof(smc->chopper.param_svpwm_mode), "uint16_t", "chopper_svpwm_mode");
    // self->RegisterVariableToTable(self, FlashParamId_chopper_param_base_pwm, FlashParam_RebootToTakeEffect_No, &(smc->chopper.param_base_pwm), sizeof(smc->chopper.param_base_pwm), "float", "chopper_base_pwm");
    // self->RegisterVariableToTable(self, FlashParamId_chopper_param_offset_pwm_en, FlashParam_RebootToTakeEffect_No, &(smc->chopper.param_offset_pwm_en), sizeof(smc->chopper.param_offset_pwm_en), "uint16_t", "chopper_offset_pwm_en");
    // self->RegisterVariableToTable(self, FlashParamId_chopper_param_offset_pwm, FlashParam_RebootToTakeEffect_No, &(smc->chopper.param_offset_pwm), sizeof(smc->chopper.param_offset_pwm), "float", "chopper_offset_pwm");
    // self->RegisterVariableToTable(self, FlashParamId_chopper_param_hybrid_decay_ratio, FlashParam_RebootToTakeEffect_No, &(smc->chopper.param_hybrid_decay_ratio), sizeof(smc->chopper.param_hybrid_decay_ratio), "float", "chopper_hybrid_decay_ratio");

    /*** step controller param */
    // self->RegisterVariableToTable(self, FlashParamId_step_controller_param_pulse_count_max, FlashParam_RebootToTakeEffect_No, &(smc->step_controller.param_pulse_count_max), sizeof(smc->step_controller.param_pulse_count_max), "uint16_t", "step_pulse_count_max");
    self->RegisterVariableToTable(self, FlashParamId_step_controller_param_subdivision, FlashParam_RebootToTakeEffect_No, &(smc->step_controller.param_subdivision), sizeof(smc->step_controller.param_subdivision), "uint16_t", "step_subdivision");
    // self->RegisterVariableToTable(self, FlashParamId_step_controller_param_pulse_trim_en, FlashParam_RebootToTakeEffect_No, &(smc->step_controller.param_pulse_trim_en), sizeof(smc->step_controller.param_pulse_trim_en), "uint16_t", "step_pulse_trim_en");
    // self->RegisterVariableToTable(self, FlashParamId_step_controller_param_trim_action_period, FlashParam_RebootToTakeEffect_No, &(smc->step_controller.param_trim_action_period), sizeof(smc->step_controller.param_trim_action_period), "uint16_t", "step_trim_action_period");
    // self->RegisterVariableToTable(self, FlashParamId_step_controller_param_extra_trim_pulse, FlashParam_RebootToTakeEffect_No, &(smc->step_controller.param_extra_trim_pulse), sizeof(smc->step_controller.param_extra_trim_pulse), "uint16_t", "step_extra_trim_pulse");

    /*** communication interface param */
    self->RegisterVariableToTable(self, FlashParamId_cmd_int_param_char_cmd_support, FlashParam_RebootToTakeEffect_No, &(smc->communication_interface.param_char_cmd_support), sizeof(smc->communication_interface.param_char_cmd_support), "uint16_t", "com_char_cmd_support");

    /*** system id RL param */
    self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_uin_startup, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_uin_series[0]), sizeof(smc->system_id_RL.param_uin_series[0]), "float", "system_id_RL_uin_startup");
    self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_uin_calibrate, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_uin_series[1]), sizeof(smc->system_id_RL.param_uin_series[1]), "float", "system_id_RL_uin_calibrate");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_current_stable_err_condition, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_current_stable_err_condition), sizeof(smc->system_id_RL.param_current_stable_err_condition), "float", "system_id_RL_current_stable_err_condition");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_current_buff_size, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_current_buff_size), sizeof(smc->system_id_RL.param_current_buff_size), "uint16_t", "system_id_RL_current_buff_size");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_current_err_size, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_current_err_size), sizeof(smc->system_id_RL.param_current_err_size), "uint16_t", "system_id_RL_current_err_size");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_prepare_time, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_prepare_time), sizeof(smc->system_id_RL.param_prepare_time), "uint16_t", "system_id_RL_prepare_time");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_normal_R_range_min, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_normal_R_range_min), sizeof(smc->system_id_RL.param_normal_R_range_min), "float", "system_id_RL_normal_R_range_min");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_normal_R_range_max, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_normal_R_range_max), sizeof(smc->system_id_RL.param_normal_R_range_max), "float", "system_id_RL_normal_R_range_max");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_param_normal_L_range_min, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_normal_L_range_min), sizeof(smc->system_id_RL.param_normal_L_range_min), "float", "system_id_RL_normal_L_range_min");
    // self->RegisterVariableToTable(self, FlashParamId_system_id_RL_param_normal_L_range_max, FlashParam_RebootToTakeEffect_No, &(smc->system_id_RL.param_normal_L_range_max), sizeof(smc->system_id_RL.param_normal_L_range_max), "float", "system_id_RL_normal_L_range_max");

    /*** motor phase check param*/
    // self->RegisterVariableToTable(self, FlashParamId_motor_phase_check_param_run_on_startup, FlashParam_RebootToTakeEffect_No, &(smc->motor_phase_check.param_run_on_startup), sizeof(smc->motor_phase_check.param_run_on_startup), "uint16_t", "motor_phase_check_run_on_startup");
    // self->RegisterVariableToTable(self, FlashParamId_motor_phase_check_param_motor_resistance_tolerance_standar_percent, FlashParam_RebootToTakeEffect_No, &(smc->motor_phase_check.param_motor_resistance_tolerance_standar_percent), sizeof(smc->motor_phase_check.param_motor_resistance_tolerance_standar_percent), "float", "motor_phase_check_motor_resistance_tolerance_standar_percent");

    /*** zazen mode param */
    self->RegisterVariableToTable(self, FlashParamId_zazen_param_zazen_en, FlashParam_RebootToTakeEffect_No, &(smc->zazen_mode.param_en), sizeof(smc->zazen_mode.param_en), "uint16_t", "zazen_en");
    self->RegisterVariableToTable(self, FlashParamId_zazen_param_zazen_trigger_time_s, FlashParam_RebootToTakeEffect_No, &(smc->zazen_mode.param_trigger_time_s), sizeof(smc->zazen_mode.param_trigger_time_s), "float", "zazen_trigger_time_s");
    // self->RegisterVariableToTable(self, FlashParamId_zazen_param_zazen_gain_pos_kp, FlashParam_RebootToTakeEffect_No, &(smc->zazen_mode.param_gain.pos_kp), sizeof(smc->zazen_mode.param_gain.pos_kp), "float", "zazen_gain_pos_kp");
    self->RegisterVariableToTable(self, FlashParamId_zazen_param_zazen_gain_spd_kp, FlashParam_RebootToTakeEffect_No, &(smc->zazen_mode.param_gain.spd_kp), sizeof(smc->zazen_mode.param_gain.spd_kp), "float", "zazen_gain_spd_kp");
    self->RegisterVariableToTable(self, FlashParamId_zazen_param_zazen_gain_spd_ki, FlashParam_RebootToTakeEffect_No, &(smc->zazen_mode.param_gain.spd_ki), sizeof(smc->zazen_mode.param_gain.spd_ki), "float", "zazen_gain_spd_ki");
    self->RegisterVariableToTable(self, FlashParamId_zazen_param_zazen_gain_cur_kp, FlashParam_RebootToTakeEffect_No, &(smc->zazen_mode.param_gain.cur_kp), sizeof(smc->zazen_mode.param_gain.cur_kp), "float", "zazen_gain_cur_kp");
    self->RegisterVariableToTable(self, FlashParamId_zazen_param_zazen_gain_cur_ki, FlashParam_RebootToTakeEffect_No, &(smc->zazen_mode.param_gain.cur_ki), sizeof(smc->zazen_mode.param_gain.cur_ki), "float", "zazen_gain_cur_ki");

    /*** flash key */
    self->RegisterVariableToTable(self, FlashParamId_param_flash_key, FlashParam_RebootToTakeEffect_No, &(self->flash_param_valid_key), sizeof(self->flash_param_valid_key), "uint16_t", "flash_key");

    /*** check sum */
    self->RegisterVariableToTable(self, FlashParamId_param_flash_checksum, FlashParam_RebootToTakeEffect_No, &(smc->flash_manager_param->flash_checksum), sizeof(smc->flash_manager_param->flash_checksum), "uint16_t", "flash_checksum");
}
